/**
 * 应用状态常量
 * 对应后端 AppStatusConstant 接口
 */

// 部署状态枚举
export const DEPLOY_STATUS = {
  // 未部署
  NOT_DEPLOYED: 0,
  // 已部署
  DEPLOYED: 1,
  // 部署中
  DEPLOYING: 2,
} as const

// 生成状态枚举
export const GENERATE_STATUS = {
  // 未生成
  NOT_GENERATED: 0,
  // 生成中
  GENERATING: 1,
  // 生成完成
  COMPLETED: 2,
  // 生成失败
  FAILED: 3,
  // 生成中断
  INTERRUPTED: 4,
} as const

// 部署状态文本映射
export const DEPLOY_STATUS_TEXT = {
  [DEPLOY_STATUS.NOT_DEPLOYED]: '未部署',
  [DEPLOY_STATUS.DEPLOYED]: '已部署',
  [DEPLOY_STATUS.DEPLOYING]: '部署中',
} as const

// 生成状态文本映射
export const GENERATE_STATUS_TEXT = {
  [GENERATE_STATUS.NOT_GENERATED]: '未生成',
  [GENERATE_STATUS.GENERATING]: '生成中',
  [GENERATE_STATUS.COMPLETED]: '生成完成',
  [GENERATE_STATUS.FAILED]: '生成失败',
  [GENERATE_STATUS.INTERRUPTED]: '已中断',
} as const

// 部署状态颜色映射
export const DEPLOY_STATUS_COLOR = {
  [DEPLOY_STATUS.NOT_DEPLOYED]: 'default',
  [DEPLOY_STATUS.DEPLOYED]: 'success',
  [DEPLOY_STATUS.DEPLOYING]: 'processing',
} as const

// 生成状态颜色映射
export const GENERATE_STATUS_COLOR = {
  [GENERATE_STATUS.NOT_GENERATED]: 'default',
  [GENERATE_STATUS.GENERATING]: 'processing',
  [GENERATE_STATUS.COMPLETED]: 'success',
  [GENERATE_STATUS.FAILED]: 'error',
  [GENERATE_STATUS.INTERRUPTED]: 'warning',
} as const

// 类型定义
export type DeployStatus = typeof DEPLOY_STATUS[keyof typeof DEPLOY_STATUS]
export type GenerateStatus = typeof GENERATE_STATUS[keyof typeof GENERATE_STATUS]
